package org.dxy.types.controller;

import org.dxy.api.response.R;
import org.dxy.api.vo.ButtonPermissionVo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;
import java.util.List;

/**
 * @ description:
 * @ author: dxy
 * @ createTime: 2025/7/8 21:40
 */

@RestController
@RequestMapping("/api/auth")
public class UserAuthController {
    /**
     * 获取当前用户的按钮权限（写死示例）
     */
    @GetMapping("/buttons")
    public R getUserButtonPermissions() {

        List<String> authButton = Arrays.asList("add", "edit", "delete", "import", "export");
        List<String> useProTable = Arrays.asList("add", "batchAdd", "export", "batchDelete", "status");

        ButtonPermissionVo buttonPermissionVo = new ButtonPermissionVo(authButton, useProTable);
        return R.ok(buttonPermissionVo,"成功");
    }
}
